
import requests

from utils.logger_util import logger

host = "http://123.60.59.40:9090/"

class Request:
    log = logger.getLog()
    def get(self, url, **kwargs):
        self.log.info("准备发起qet请求, url:{}".format(url))
        self.log.info("请求参数：{}".format(kwargs))

        r = requests.get(url=url, **kwargs)

        self.log.info("响应状态码：{}".format(r.status_code))
        self.log.info("响应内容：{}".format(r))
        return r

    def post(self, url, **kwargs):
        self.log.info("准备发起post请求, url:{}".format(url))
        self.log.info("请求参数：{}".format(kwargs))

        r = requests.post(url=url, **kwargs)

        self.log.info("响应状态码：{}".format(r.status_code))
        self.log.info("响应内容：{}".format(r))
        return r

